package com.dora.rabbitmq.listener;

import com.dora.rabbitmq.po.Mail;
import lombok.extern.slf4j.Slf4j;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

import java.io.IOException;

@Slf4j
@Component
public class SubscribeListener1 {
    @RabbitListener(queues = "queue1")
    public void subscribe(Mail mail) throws IOException {
        log.info("订阅者1,收到消息:" + mail.toString());
    }
}
